package org.x.yuenovel.exception;

import org.x.yuenovel.enums.ResultCodeEnum;

/**
 * @Author Ning Meng
 * @Date 2022/4/22 10:40
 **/

public class ApiException extends RuntimeException {
    private String errorCode;

    public ApiException(ResultCodeEnum errorCode) {
        super(errorCode.getMsg());
        this.errorCode = errorCode.getCode();
    }

    public ApiException(String message) {
        super(message);
    }

    public ApiException(Throwable cause) {
        super(cause);
    }

    public ApiException(String message, Throwable cause) {
        super(message, cause);
    }

    public String getErrorCode() {
        return errorCode;
    }
}
